from xeger import Xeger
import re
import sys

def myYield(n,regx):
    _x = Xeger()
    while n>0:
        # print("start")
        yield _x.xeger(regx)
        # print("end")
        n-=1
if __name__=="__main__":
    print("--------------------------------------------------")
    regx="^([0-9A-Za-z\-_\.]+)@([0-9a-z]+\.[a-z]{2,3}(\.[a-z]{2})?)$"
    for item in myYield(1000,regx):
        print(item)


        # 下面是验证
        an=re.search(regx,item)
        if an:
            print('满足正则表达式\n')
        else:
            print('no')

